/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fasea.model;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 *
 * @author WolframL
 */
public class IndexingFolder{
        private File indexingFolder;
        private List<String> fileExtensionRestrictions = new ArrayList<String>();
        
        public IndexingFolder(File indexingFolder, String ... fileExtensionRestrictions){
            this.indexingFolder = indexingFolder;
            for(String fileExtensionRestriction : fileExtensionRestrictions){
                if(!fileExtensionRestriction.trim().isEmpty()){
                    this.fileExtensionRestrictions.add(fileExtensionRestriction.trim());
                }
            }
        }
        
        public File getIndexingFolder(){
            return indexingFolder;
        }
        
        public List<String> getFileExtensionRestrictions(){
            return fileExtensionRestrictions;
        }
        
        public String getFileExtensionRestrictionsAsString(){
            StringBuilder b = new StringBuilder();
            for(String fileExtensionRestriction : fileExtensionRestrictions){
                if(b.length() != 0){
                    b.append(",");
                }
                b.append(fileExtensionRestriction);
            }
            return b.toString();
        }
    }
